/*
 * @Author: gk 
 *  用户管理
 * @Date: 2018-03-15 14:44:57 
 * @Last Modified by: csy
 * @Last Modified time: 2019-09-19 14:33:13
 */
layui.config({}).use(['element', 'zlshenhjm', 'zlConfig', 'zlContext', 'zlSelectMultiple', 'zlSelectEx', 'zlpoptree', 'zlSelecttree', 'table', 'layer', 'laydate', 'form', 'zlPinYin', 'upload'], function (exports) {
	var $ = layui.$,
		zlContext = layui.zlContext,
		layer = layui.layer,
		laydate = layui.laydate,
		table = layui.table,
		form = layui.form,
		upload = layui.upload,
		zlPinYin = layui.zlPinYin,
		zlConfig = layui.zlConfig,
		statusName = zlConfig.global.result.statusName,
		msgName = zlConfig.global.result.msgName,
		dataName = zlConfig.global.result.dataName,
		OK = zlConfig.global.result.okState,
		zlshenhjm = layui.zlshenhjm,
		fullheight = 'full-30',
		customCurr = 1;

	//iframe自适应
	$(window).on('resize', function () {
		zlContext.setMaxHeihgt(0);
	}).resize();
	var treeObj,
		tableObj,
		fromlayerIndex,
		isloadsearch = false;

	//渲染用户列表
	tableObj = table.render({
		elem: '#tbUser',
		height: fullheight,
		response: zlConfig.global.gridResponse,
		limit: 999,
		page: true,
		updId: "4D309E7A69B949549A2D90D8E7B8C248",
		toolbar: "#toolbarUserAudit",
		defaultToolbar: ['filter'],
		where: {},
		url: layui.cache['contentPath'] + '/admin/coreuser/queryunaudit',
		method: 'post',
		limit: 20,
		limits: [20, 50, 100, 200, 500, 1000],
		sortload: true,
		cols: [
			[ //表头
				{
					type: 'numbers',
					fixed: 'left',
					title: '#'
				}, {
					type: 'checkbox',
					fixed: 'left'
				}, {
					field: 'ZHANGHM',
					title: '账户名',
					width: 100,
					sort: true
				}, {
					field: 'OBJNAME',
					title: '姓名',
					width: 75,
					sort: true
				}, {
					field: 'SHOUJH',
					title: '手机号',
					width: 100,
					sort: true
				}, {
					field: 'YOUX',
					title: '邮箱',
					width: 100
				}, {
					field: 'DIZ',
					title: '地址',
					width: 80
				}, {
					field: 'DES',
					title: '描述',
					width: 80
				}, {
					field: 'GONGH',
					title: '工号',
					width: 80
				}, {
					field: 'SHENFZH',
					title: '身份证',
					width: 80
				}, {
					field: 'XINGB',
					title: '性别',
					width: 80,
					templet: '<div><span>{{#  if(d.XINGB==0){ }}  女 {{}} {{#  } else {}}  男 {{#  } }}</span></div>'
				}, {
					field: 'TOUX',
					title: '头像',
					width: 80,
					templet: function (d) {
						var toux
						if (d.TOUX) {
							toux = d.TOUX
						} else {
							toux = '/static/image/userImg.png'
						}
						return '<div><img atl="" src="' + layui.cache['contentPath'] + toux + '" style="width:27px;height:27px"></div>'
					}
				}, {
					field: 'ISUSED',
					title: '用户状态',
					width: 80,
					unresize: true,
					templet: function (d) {
						return '<input type="checkbox" name="ISUSED" value="' + d.MXZD_YUNXWK + '" disabled lay-skin="switch" lay-text="启用|停用" lay-filter="ISUSED" ' + (d.ISUSED == 1 ? 'checked' : '') + '>';
					}
				}
				// , {
				// 	field: 'ISPASSED', title: '审核', width: 80, unresize: true, templet: function (d) {
				// 		return '<input type="checkbox" name="ISPASSED" value="' + d.ISPASSED + '" disabled lay-skin="switch" lay-text="通过|驳回" lay-filter="ISPASSED" ' + (d.ISPASSED == 1 ? 'checked' : '') + '>';
				// 	}
				// }
				, {
					field: 'ISTOPMGR',
					title: '是否管理员',
					width: 80,
					templet: '<div><span>{{#  if(d.ISTOPMGR==0){ }}  否 {{}} {{#  } else {}}  是 {{#  } }}</span></div>'
				}, {
					field: 'MNGDEPNS',
					title: '部门',
					width: 160
				}, {
					field: 'ROLENS',
					title: '角色',
					width: 100,
					sort: true
				}, {
					fixed: 'right',
					width: 180,
					title: '操作',
					align: 'center',
					toolbar: '#barUser'
				}
			]
		],
		event: {
			onRowdbClick: function (field, row) {
				gridAction.viewRow(row);
			}
		}
	});

	var gridAction = {
		currentEditObj: undefined,
		userGridedit: function (row, type, readonly) {
			var readonly = readonly && readonly != 0 ? 'disabled' : '';
			var frm = [
				'<div class="site-block layui-fluid" lay-filter="divgridUser"> ',
				' <form id ="frmGridUser" class="layui-form"  action="">',
				'	<div class="layui-form-item layui-hide">',
				'		<div class="layui-input-block">',
				'			<input type="text" name="EDITTYPE" class="layui-input">',
				'			<input type="text" name="RWID" class="layui-input">',
				'			<input type="text" name="ORGID" class="layui-input">',
				'			<input type="text" name="TOUX" class="layui-input">',
				'			<input type="text" name="MNGDEPIDS" class="layui-input">',
				'			<input type="text" name="ROLEIDS" class="layui-input">',
				'		</div>',
				'	</div>',
				'	<div class="layui-form-item">',
				'		<div class="layui-input-block">',
				'			<div class="layui-upload">',
				' 			<div class="layui-upload-list">',
				'					<img src="' + layui.cache['contentPath'] + '/static/image/userImg.png" class="layui-upload-img" id="imgPrieviewPic">',
				'					<p id="demoText"></p>',
				'				</div>',
				'	  			<button type="button" class="layui-btn" id="btnUploadfile" ' + readonly + '>上传头像</button>',
				'			</div>',
				'		</div>',
				'	</div>',
				'	<div class="layui-form-item">',
				' 	<div class="layui-inline">',
				'			<label class="layui-form-label">姓名</label>',
				'			<div class="layui-input-block">',
				'				<input type="text" name="OBJNAME" ' + readonly + ' lay-verify="required|name" maxlength="32" placeholder="请输入中文姓名"  class="layui-input" autocomplete="off">', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">账户名</label>', '			<div class="layui-input-block">', '				<input type="text" name="ZHANGHM" ' + readonly + ' lay-verify="required|username" placeholder="请输入账户名" maxlength="16" class="layui-input" autocomplete="off">', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">编号</label>', '			<div class="layui-input-block">', '				<input type="text" name="OBJCODE" ' + readonly + ' lay-verify="required" placeholder="请输入编号" maxlength="10" class="layui-input">', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">性别</label>', '			<div class="layui-input-block">', '				<input type="radio" name="XINGB" value="1" title="男" ' + readonly + '>', '				<input type="radio" name="XINGB" value="0" title="女" ' + readonly + '>', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">手机号</label>', '			<div class="layui-input-block">', '				<input type="text" name="SHOUJH" ' + readonly + ' lay-verify="required|phone|number" maxlength="11" placeholder="请输入手机号"  class="layui-input">', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">邮箱</label>', '			<div class="layui-input-block">', '				<input type="text" name="YOUX" ' + readonly + ' lay-verify="email" autocomplete="off" placeholder="请输入邮箱" maxlength="50" class="layui-input">', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">工号</label>', '			<div class="layui-input-block">', '				<input type="text" name="GONGH" ' + readonly + ' lay-verify="number" placeholder="请输入工号" maxlength="32" class="layui-input">', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">身份证</label>', '			<div class="layui-input-block">', '				<input type="text" name="SHENFZH" ' + readonly + ' lay-verify="identity" placeholder="请输入身份证" maxlength="18" class="layui-input">', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">出生年月日</label>', '			<div class="layui-input-block">', '				<input type="text" class="layui-input"  name="CHUSRQ"' + readonly + ' placeholder="yyyy-MM-dd" lay-verify="date">', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">籍贯</label>', '			<div class="layui-input-block">', ' 			<div name="JIG_ID" zlcomponent ' + readonly + ' class="layui-form-select zlpoptree" settings="{multselect:false,method:\'GET\' ,placeholder:\'请选择籍贯\',id:\'DCMX_KEY\',idKey:\'DCMX_KEY\',pIdKey:\'SYS_PARENTID\',name:\'VALUE\',dataurl:\'' + layui.cache['contentPath'] + '/manager/coredictionary/querydictionarybyid?RWID=317D2C269FBA41BC8946F8F431745ADC' + '\',formtitle:\'选择籍贯\'}"></div>', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">民族</label>', '			<div class="layui-input-block">', '		  		<select name="MINZ_ID" ' + readonly + ' zlcomponent class="select-ext" settings="{titlefield: \'VALUE\', valuefield: \'DCMX_KEY\',dataurl:\'' + layui.cache['contentPath'] + '/manager/coredictionary/querydictionarybyid?RWID=9B232442111F498DBEEF7E70530B2202' + '\'}">', '		  		</select>', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">参加工作</label>', '			<div class="layui-input-block">', '				<input type="text" class="layui-input"  name="CANJGZRQ"' + readonly + ' placeholder="yyyy-MM" lay-verify="date">', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">政治面貌</label>', '			<div class="layui-input-block">', '		  		<select name="ZHENGZMM_ID" ' + readonly + ' zlcomponent class="select-ext" settings="{titlefield: \'VALUE\', valuefield: \'DCMX_KEY\',dataurl:\'' + layui.cache['contentPath'] + '/manager/coredictionary/querydictionarybyid?RWID=E5FADBE1450C49759CC71A1CFD94AE60' + '\'}">', '		  		</select>', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">学历</label>', '			<div class="layui-input-block">', '		  		<select name="XUEL_ID" ' + readonly + ' zlcomponent class="select-ext" settings="{titlefield: \'VALUE\', valuefield: \'DCMX_KEY\',dataurl:\'' + layui.cache['contentPath'] + '/manager/coredictionary/querydictionarybyid?RWID=F72C50108DBD41BBB6223FE82E0F4915' + '\'}">', '		  		</select>', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">毕业院校</label>', '			<div class="layui-input-block">', '				<input type="text" class="layui-input"  maxlength="16" placeholder="请输入毕业院校" name="BIYYX"' + readonly + '>', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">专业</label>', '			<div class="layui-input-block">', '				<input type="text" class="layui-input" maxlength="16" placeholder="请输入专业" name="ZHUANY"' + readonly + '>', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">紧急联系人</label>', '			<div class="layui-input-block">', '				<input type="text" class="layui-input" maxlength="32" lay-verify="name" placeholder="请输入紧急联系人" name="JINJLXR"' + readonly + '>', '			</div>', '		</div>', ' 	<div class="layui-inline">', '			<label class="layui-form-label">联系人手机号</label>', '			<div class="layui-input-block">', '				<input type="text" class="layui-input" placeholder="请输入联系人手机号" name="JINJLXRSJH"' + readonly + ' lay-verify="phone|number" maxlength="11">', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', '		<label class="layui-form-label">所属角色</label>', '			<div class="layui-input-block">', '		  		<div name="ROLEIDS" zlcomponent="" class="layui-form-select select-multiple" lay-verify="required" settings="{edittype:\'' + readonly + '\', placeholder:\'请选择角色\', titlefield: \'VALUE\', valuefield: \'KEY\',dataurl:\'' + layui.cache['contentPath'] + '/core/role/queryrolekeyvaluelist\'}">', '		  		</div>', '			</div>', '	</div>', '	<div class="layui-form-item">', '			<label class="layui-form-label">监管部门</label>', '			<div class="layui-input-block">', '	  			<div name="JIANGBM" zlcomponent ' + readonly + ' class="layui-form-select select-tree" settings="{Multiple:true,chkboxType:\'{ Y: &quot;&quot;, N: &quot;&quot; }\', placeholder:\'请选择部门\', name: \'OBJNAME\', idKey: \'RWID\', pIdKey: \'SYS_PARENTID\', rootPid: null, method:\'post\',params:\'{ORGID:&quot;' + row['ORGID'] + '&quot;}\' ,dataurl:\'' + layui.cache['contentPath'] + '/admin/bddept/queryuse\'}"></div>', '			</div>', '	</div>', '	<div class="layui-form-item">', '			<label class="layui-form-label">所属部门</label>', '			<div class="layui-input-block">', '	  			<div name="MNGDEPIDS" zlcomponent ' + readonly + ' class="layui-form-select select-tree" lay-verify="required" settings="{edittype:\'' + readonly + '\', Multiple:true,chkboxType:\'{ Y: &quot;&quot;, N: &quot;&quot; }\', placeholder:\'请选择部门\', name: \'OBJNAME\', idKey: \'RWID\', pIdKey: \'SYS_PARENTID\', rootPid: null, method:\'post\',params:\'{ORGID:&quot;' + row['ORGID'] + '&quot;}\' ,dataurl:\'' + layui.cache['contentPath'] + '/admin/bddept/queryuse\'}"></div>', '			</div>', '	</div>', '	<div class="layui-form-item">', '		<label class="layui-form-label">家庭地址</label>', '		<div class="layui-input-block">', '			<textarea placeholder="请输入地址" name="DIZ" class="layui-textarea" ' + readonly + ' maxlength="33"></textarea>', '		</div>', '	</div>', '	<div class="layui-form-item">', '		<label class="layui-form-label">描述</label>', '		<div class="layui-input-block">', '			<textarea placeholder="请输入描述" name="DES" class="layui-textarea" ' + readonly + ' maxlength="16"></textarea>', '		</div>', '	</div>', '	<div class="layui-form-item">', ' 	<div class="layui-inline">', '			<label class="layui-form-label">用户状态</label>', '			<div class="layui-input-block">', '				<input type="checkbox" name="ISUSED" valueformat="1|0" lay-text="启用|停用" lay-skin="switch" ' + readonly + '>', '			</div>', '		</div>', '	</div>', '	<div class="layui-form-item">', '		<div class="layui-input-block">', '		  <button class="layui-btn" lay-submit lay-filter="frmGridUser"  ' + readonly + '>保存</button>'
				// , '		  <button type="reset" class="layui-btn layui-btn-primary ' + (type == 'edit' ? 'layui-hide"' : '"') + readonly + '>重置</button>'
				, '		</div>', '	</div>', '</form></div>'
			];
			layer.open({
				type: 1,
				limit: 999,
				maxmin: true, //最大化按钮
				title: readonly == 'disabled' ? '查看' : (type == 'edit' ? '用户编辑' : '用户新增'),
				id: 'coreuserAuditLayer',
				area: ['100%', '100%'],
				content: frm.join(''),
				success: function (layero, index) {
					laydate.render({
						elem: $('input[name="CHUSRQ"]')[0] //指定元素
					});
					laydate.render({
						elem: $('input[name="CANJGZRQ"]')[0], //指定元素
						type: 'month'
					});

					var uploadInst = upload.render({
						elem: '#btnUploadfile',
						accept: 'file', //所有的文件
						url: layui.cache['contentPath'] + '/admin/coreuser/upload/',
						before: function (obj) { },
						done: function (res) {
							if (res[statusName] != OK) {
								$('#imgPrieviewPic').attr('src', '');
								return layer.msg('上传失败' + res[msgName]);
							} else {
								$(res[dataName]).each(function (index, obj) {
									$('#imgPrieviewPic').attr('src', layui.cache['contentPath'] + obj["newFileName"]);
									$('#frmGridUser input[name=TOUX]').val(obj["newFileName"]);
								});
							}
						},
						error: function () {
							layer.msg('上传失败');
						}
					});
					if (type == 'edit') {
						zlContext.autoFill($('#frmGridUser'), row);
						$('#frmGridUser input[name=EDITTYPE]').val('edit');
						$('#frmGridUser input[name=ORGID]').val(row['ORGID']);
						$('#frmGridUser input[name=TOUX]').val(row['TOUX']);
						$('#frmGridUser input[name=RWID]').val(row['RWID']);
						if ($('#frmGridUser input[name=TOUX]').val()) {
							$('#imgPrieviewPic').attr('src', layui.cache['contentPath'] + $('#frmGridUser input[name=TOUX]').val());
						}
					} else {
						form.render();
						/**设置隐藏属性*/
						$('#frmGridUser input[name=EDITTYPE]').val('new');
						$('#frmGridUser input[name=OBJNAME]').change(function () {
							var v = $('#frmGridUser input[name=OBJNAME]').val();
							/**部门名 */
							var v1 = zlPinYin.C(v);
							$('#frmGridUser input[name=ZHANGHM]').val(v1);
							$('#frmGridUser input[name=OBJCODE]').val(v1);
						});
					}
					if (readonly == 'disabled') {
						$('[placeholder]').attr('placeholder', '');
					}
					fromlayerIndex = index;
				},
				cancel: function (index, layero) {
					if (type == 'edit' && readonly != 'disabled') {
						zlContext.isFormDataChange('frmGridUser', gridAction.currentEditObj.data, gridAction, index);
						return false;
					}
				}
			});
		},
		viewRow: function (row) {
			gridAction.userGridedit(row, 'edit', true);
		},
		newRow: function () {
			var nodes = treeObj.getSelectedNodes();
			if (nodes.length == 0) {
				zlContext.warnMsg('请选择部门节点');
				return;
			}
			if (nodes[0].EXPANDPROPERTY == 'org') {
				zlContext.warnMsg('无法在机构下新增用户,请选择部门');
				return;
			}
			gridAction.userGridedit(null, 'new');
		},
		editRow: function (row) {
			gridAction.userGridedit(row, 'edit');
		},
		deleteRows: function (rows) {
			if (rows.length == 0) {
				zlContext.warnMsg('请选择需要删除的用户');
				return;
			}
			zlContext.confirm('询问', '是否要删除选择的用户?', function (index) {
				ids = [];
				rows.forEach(function (v) {
					ids.push(v.data ? v.data['RWID'] : v['RWID']);
				});
				//提交删除
				zlContext.deletePost(layui.cache['contentPath'] + '/admin/coreuser/remove', {
					ids: ids
				}, function (result) {
					if (result[statusName] == OK) {
						if (rows[0].del)
							rows[0].del();
						else
							gridAction.refreshGrid('del', null);
					} else {
						zlContext.errorMsg(result[msgName]);
					}
				});
				layer.close(index);
			});
		},
		// 审批
		auditRows: function (rows) {
			var processids = '',
				rwids = '';
			for (var i = 0; i < rows.length; i++) {
				processids = processids + "," + rows[i].SYS_PID;
				rwids = rwids + "," + rows[i].RWID;
			}
			processids = processids.substring(1, processids.length);
			rwids = rwids.substring(1, rwids.length);
			var params = {
				processids: processids,
				rwids: rwids
			};
			zlshenhjm.render(processids, layui.cache['contentPath'] + '/admin/coreuser/audituser', params, null, function () {
				zlContext.successMsg('用户审核成功！');
				layui.event('WM_USERDEF',
					zlConfig.global.WM_USERDEF.REFRESHDATA_DATA, null);
			});
		},
		sumbit: function (fields) {
			var editType = $('#frmGridUser input[name=EDITTYPE]').val();
			if (editType == 'new') {
				zlContext.put(layui.cache['contentPath'] + '/admin/coreuser/add', fields, function (result) {
					if (result[statusName] == OK) {
						gridAction.refreshGrid(editType, result[dataName]);
						layer.close(fromlayerIndex);
						return true;
					} else {
						zlContext.errorMsg(result[msgName]);
					}
				});
			}
			if (editType == 'edit') {
				zlContext.post(layui.cache['contentPath'] + '/admin/coreuser/modify', fields, function (result) {
					if (result[statusName] == OK) {
						gridAction.refreshGrid(editType, fields);
						layer.close(fromlayerIndex);
						return true;
					} else {
						zlContext.errorMsg(result[msgName]);
					}
				});
			}
			return false;
		},
		search: function () {
			layui.event('WM_USERDEF',
				zlConfig.global.WM_USERDEF.REFRESHDATA_DATA, null);
		},
		refreshGrid: function (type, row) {
			/**刷新行 */
			if (type == 'edit' && gridAction.currentEditObj) {
				gridAction.currentEditObj.update(row);
			} else if (type == 'new') {
				tableObj.reload('tbUser');
			} else if (type == 'del') {
				table.deleteCheckRows('tbUser');
			}
			form.render();
		}
	}
	$('#btnUserDelete').on('click', function () {
		var checkStatus = table.checkStatus('tbUser'),
			rows = checkStatus.data;
		gridAction.deleteRows(rows);
	});
	// $('#btnSeacher').on('click', function () {
	// 	customCurr = 1;
	// 	gridAction.search();
	// });
	$('.layui-card-body').on('keyup', '#edtSeacherValue', function (event) {
		var keyCode = event.keyCode;
		customCurr = 1;
		$('.layui-card-body').attr('data-search', $(this).val())
		if (keyCode == 13) {
			gridAction.search();
		}
		if ((keyCode == '46' || keyCode == '8' || (event.ctrlKey && keyCode == '86')) && $(this).val() == '' && isloadsearch) {
			$('#btnSeacher').trigger('click');
			isloadsearch = false;
		}
	});
	//头工具栏事件
	table.on('toolbar(tbUser)', function (obj) {
		var checkStatus = table.checkStatus(obj.config.id);
		var rows = checkStatus.data;
		switch (obj.event) {
			case 'btnSeacher':
				customCurr = 1;
				gridAction.search();
				break;
			case 'userAudit':
				if (rows.length == 0) {
					zlContext.warnMsg('请选择需要审核的用户！');
					return;
				}
				gridAction.auditRows(rows);
				break;
		};
	});
	//监听行工具事件
	table.on('tool(tbUser)', function (obj) {
		var row = obj.data, //获得当前行数据
			layEvent = obj.event, //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
			rows = new Array();
		rows.push(row);
		if (layEvent === 'detail') { //查看
			gridAction.viewRow(row)
		} else if (layEvent === 'shenh') { //删除
			gridAction.auditRows(rows);
		} else if (layEvent === 'edit') { //编辑
			gridAction.currentEditObj = obj;
			gridAction.editRow(row);
		}
	});
	//提交
	form.on('submit(frmGridUser)', function (frm) {
		if ($(frm.elem).hasClass('getField')) {
			gridAction.newFields = frm.field;
			return false;
		}
		return gridAction.sumbit(frm.field);
	});

	//监听刷新的事件
	layui.event('WM_USERDEF', zlConfig.global.WM_USERDEF.REFRESHDATA_DATA, null, function (node) {
		var index = layer.msg('数据查询中，请稍候', {
			icon: 16,
			time: false,
			shade: 0.1
		});
		var loadGridData = function (id, url, param) {
			tableObj.reload({
				url: url,
				method: 'post',
				page: {
					curr: customCurr
				},
				where: param,
				done: function (res, curr, count) {
					$('#edtSeacherValue').val($('.layui-card-body').attr('data-search'))
					layer.close(index);
					customCurr = curr;
				}
			}, true);
		}
		var params = {};
		if ($('#edtSeacherValue').val() !== '') {
			params['OBJNAME'] = '%' + $('#edtSeacherValue').val() + '%';
			isloadsearch = true;
		}
		loadGridData('tbUser', layui.cache['contentPath'] + '/admin/coreuser/queryunaudit', params);
	});
});